const Koa = require('./koa')


const app = new Koa();

app.use(async (ctx,next) => {
    await next()
    await next()
  ctx.body = 'hello';
})
app.use(async (ctx,next) => {
    await next()
  ctx.body = 'world';
})
app.use(async (ctx,next) => {
    await next()
  ctx.body = '!';
})

app.on('error',(err)=>{
    console.log(err)
    // ctx.body = 'Internal Server Error'
})
app.listen(3000, () => {
    console.log('server start port 3000')
})